<% @page_title = "学生信息 | 多背一公斤 - 灾后学校重建计划" -%>

<% content_for :sidebar do -%>
  <h2><%= link_to "返回#{@school.title}", school_url(@school.id) %></h2>
  <h2><%= link_to "上传#{@student.full_name}的照片", new_photo_url(:student_id => @student.id) %></h2>
  
  <% if logged_in? && current_user.is_admin? -%>
    <%= link_to "编辑", edit_student_url(@school.id, @student.id) %><br />
    <%= link_to "删除", student_url(@school.id, @student.id), :confirm => "确定删除么？", :method => :delete %>
  <% end -%>
<% end -%>

<h1><%= @student.full_name %></h1>
<p><label for="student_info"><%= @student.gender_for_human %>，<%= @student.birth_for_human %>出生，<%= @student.enter_school_year %>年入学</label></p>

<h2><%= @student.full_name %>的照片 &middot;&nbsp; &middot;&nbsp; &middot;&nbsp; &middot;&nbsp; &middot;&nbsp; &middot;&nbsp;</h2>
<% @photos.each do |photo| -%>
  <div class="cmt-item" style="margin-bottom:10px;clear:both">
    <div style="float:left;margin:0 8px 0 0">
      <%= link_to image_tag(photo.public_filename(:small), :style=> "float:left; margin:3px"), photo_url(photo.id) %><br />
    </div>
    <div style="margin-left:240px">
        <div>
          <h2><%= link_to photo.title, photo_url(photo.id) %></h2>
        </div>
     
      <div><%= photo.description_html %></div>
    </div>
  </div>
<% end -%>
<div class="clear">
